package com.cicero.dao;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import com.cicero.model.Contact;

public class ContactDAO {
	
	private SqlSessionFactory sqlSessionFactory;
	
	public ContactDAO() {
		sqlSessionFactory = MyBatisConnectionFactory.getSqlSessionFactory();
	}
	
	public List<Contact> getSelectAll() {
		SqlSession session = sqlSessionFactory.openSession();
		
		try {
			List<Contact> list = session.selectList("Contact.getAll");
			return list;
		} finally {
			session.close();
		}
	}
	
}
